package cn.com.klun.tjy.dubbo.Impl;

import cn.com.klun.tjy.dubbo.MACDEffectStockFacadeService;
import cn.com.klun.tjy.dubbo.bean.TjyParametersVo;
import cn.com.klun.tjy.service.MainOrderEffectService;
import com.alibaba.dubbo.rpc.RpcContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Title: MACDEffectStockFacadeServiceImpl.java
 * @Description: macd参数影响
 */
@Service("mACDEffectStockFacadeServiceImpl")
public class MACDEffectStockFacadeServiceImpl implements MACDEffectStockFacadeService {

    private Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName());

    @Autowired
    private MainOrderEffectService mainOrderEffectService;

    @Override
    public TjyParametersVo getEffect(TjyParametersVo vo) {
        String clientIp = RpcContext.getContext().getRemoteHost();
        logger.info("财富管理,记账服务,客户端IP：{}, vo：{}", clientIp, vo);
        try {
            vo = mainOrderEffectService.service(vo);
        } catch (Exception e) {
            // logger.error("财富管理,记账服务,日志关联Key:{},异常：{}",vo.getLogAndKey(), Throwables.getStackTraceAsString(e));
            vo.setResDesc("财富管理,记账服务,调用异常");
        } finally {
            // logger.info("财富管理,记账服务,accountingService.service,执行时长:{},返回参数：{}" ,(System.currentTimeMillis() - startTime), vo);
        }
        return vo;

    }

}
